package us.eful.service;

import org.hibernate.Session;
import org.hibernate.Transaction;

import us.eful.data.Employee;
import us.eful.data.HibernateUtil;


public class EmployeeService {
	public Employee loadEmployee(int id) {
		Employee emp; /* = new Employee();
		emp.setId(new Integer(id)); */
		Session s = HibernateUtil.getSession();
		emp = (Employee)s.load(Employee.class, new Integer(id));
		return emp; 
	}
	public void save(Employee emp) {
		Session s = HibernateUtil.getSession();
		Transaction tx = s.beginTransaction();
		s.save(emp);
		tx.commit();
	}
}
